<template>
  <div>
    <div class="fixed">
      <SearchTop :searchShow='searchShow' @changeGoodsList='changeGoodsList'></SearchTop>
      <Sort></Sort>
    </div>

    <GoodsList class="GoodsList" :goodsList='goodsList' ></GoodsList>
    
  </div>
</template>

<script>
import SearchTop from "@/components/search/searchTop";
import Sort from "@/components/search/sort";
import GoodsList from "@/components/search/goodsList";
import http from "@/common/api/request";
export default {
  data(){
    
    return{
      goodsList:[],
      searchShow:true
    }
  },

  methods:{
     getdata() {
      http
        .$axios({
          url: `/api/goods/shopList?searchName=${this.$route.query.keyWord}`,
          // params: {
          //   searchName: this.$route.query.keyWord,
          // },
        })
        .then((res) => {
         this.goodsList=res.data.data
        
        });
    },
    changeGoodsList(res){
      this.goodsList=res.data.data
        
    }
  },
   mounted() {

    this.getdata()

  },
  
    
  
  components: {
    SearchTop,
    Sort,
    GoodsList,
  },
};
</script>

<style>
.GoodsList {
  
  margin-top: 2.4683rem;
}
.fixed{
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
}
</style>